1. Field of the Invention
The present invention relates to an apparatus for compressing and expanding data.
2. Description of the Prior Art
An apparatus for compression and expansion is used, for example, in an image forming apparatus such as a digital copying machine. The apparatus receives image data from a reading means such as an image reader or from an external apparatus and stores them in a memory in a compressed state. Then, when requested, it reads the compressed data from the memory and expands them. The expanded data are sent as image data.
Circuits used for compression and for expansion have common portions, and they are usually provided in a single chip having two functions for compression and expansion (for example, QM-CODER, Model M65760 of Mitsubishi Electric). Such a chip is very expensive because the scale of its circuit is large.
FIG. 1 is a block diagram of a prior art compression and expansion apparatus 600. It receives bi-level image data from an image reader 580 and stores them temporarily through a data transfer section 601 in an input buffer memory 602. Then, the image data are sent through the data transfer section 601 to a compression processor 603, and the compression processor 603 compresses the image data to code data and sends the code data through a data transfer section 604 to a code memory 605. The code data in the code memory 605 are read, when requested, and sent through the data transfer section 604 to an expansion processor 606. The expansion processor 606 expands the code data to image data and sends the image data through a data transfer section 607 to an output buffer memory 608. Then, the image data in the output buffer memory 608 are sent through the data transfer section 607 to a printer 650. The data transfer sections 601, 604 and 607 are controlled by a central processing unit 610.
There are three data input/output states in the compression and expansion apparatus 600: A state where image data are only received, another state where image data are received and read at the same time, and a third state where image data are only read. For example, let us assume that a digital copying machine which can also be operated as an image reader and a printer for an external apparatus has the above-mentioned compression and expansion apparatus 600. When the digital copying machine is operated as a printer for an external apparatus, the compression and expansion apparatus 600 only reads image data. When the digital copying machine is operated as a copying machine, the compression and expansion apparatus 600 reads image data of a document and performs printing based on image data which have been read already. Therefore, the compression and expansion apparatus 600 receives and reads image data at the same time.
The performance of the entire compression/expansion apparatus 600 is low because use efficiency of the chip for compression and expansion is low. As mentioned above, the chip usually performs compression of data and expansion of the compressed data. However, in the compression and expansion apparatus 600, the compression processor 603 only compresses data, while the expansion processor 606 only expands data. Then, when image data are only received, and when image data are only read, one of the two chips for compression and expansion is not used. The data compression and expansion performed in the chips for compression and expansion are very slow if compared with the data transfer in the data transfer sections 601, 604 and 607. As shown in FIG. 2, in order to increase compression and expansion speed, a second compression operator 603 and a second expansion operator 606xe2x80x2 may be added in parallel. Data are divided for the processing, and the compression/expansion speed by the apparatus is enhanced twice. However, even in this case, when image data are only received, and when image data are only read, a half of the four chips for compression and expansion is not used, and the performance of the entire compression and expansion apparatus is low.
An object of the present invention is to provide a compression and expansion apparatus which controls compression and expansion efficiently at low cost.
In a compression and expansion apparatus according to the invention, a plurality of compression/expansion processors connected in parallel are provided to compress or expand image data. A data transfer controller controls data transfer with the compression/expansion processors, and a setter sets each of the compression/expansion processors for compression or expansion according to input data transferred under the control by the data transfer controller. Thus, each compression/expansion processor is set for compression or expansion. When data are input, input data transferred to the compression/expansion processors which have been set for compression are compressed by them and stored in a memory device. When data are output, data transferred from the memory device to the compression/expansion processors which have been set for expansion are expanded by them and output to an external apparatus. Preferably, the setter performs the setting according to an amount of data to be compressed and an amount of data to be expanded. Preferably, the setter performs the setting according to an operation mode.
An advantage of the present invention is that data transfer is performed efficiently.